package data;

import java.util.LinkedList;
import java.util.List;

public class DataUserList {
	
	private List<String> userList;
	
	private DataUserList(){
		userList = new LinkedList<>();
		userList.add("All");
	}
	
	private static DataUserList dataUserList;
	
	public static DataUserList getInstance(){
		if (dataUserList==null) {
			synchronized (DataUserList.class) {
				if (dataUserList==null) {
					dataUserList = new DataUserList();
				}
			}
		}
		return dataUserList;
	}
	
	
	public void add(String userName){
		userList.add(userName);
//		Collections.sort(userList);
	}
	
	public List<String> getUserList(){
		return userList;
	}
	
	public void removeAll(){
		userList.removeAll(userList);
		userList.add("ALL");
	}
	
	public void delete(String name){
		userList.remove(name);
	}
	
}
